\(\int (a+b x)^2 \cosh (c+d x) \, dx\) [12]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 14, antiderivative size = 49 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=-\frac {2 b (a+b x) \cosh (c+d x)}{d^2}+\frac {2 b^2 \sinh (c+d x)}{d^3}+\frac {(a+b x)^2 \sinh (c+d x)}{d} \]

[Out]

-2*b*(b*x+a)*cosh(d*x+c)/d^2+2*b^2*sinh(d*x+c)/d^3+(b*x+a)^2*sinh(d*x+c)/d

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3377, 2717} \[ \int (a+b x)^2 \cosh (c+d x) \, dx=-\frac {2 b (a+b x) \cosh (c+d x)}{d^2}+\frac {(a+b x)^2 \sinh (c+d x)}{d}+\frac {2 b^2 \sinh (c+d x)}{d^3} \]

[In]

Int[(a + b*x)^2*Cosh[c + d*x],x]

[Out]

(-2*b*(a + b*x)*Cosh[c + d*x])/d^2 + (2*b^2*Sinh[c + d*x])/d^3 + ((a + b*x)^2*Sinh[c + d*x])/d

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {(a+b x)^2 \sinh (c+d x)}{d}-\frac {(2 b) \int (a+b x) \sinh (c+d x) \, dx}{d} \\ & = -\frac {2 b (a+b x) \cosh (c+d x)}{d^2}+\frac {(a+b x)^2 \sinh (c+d x)}{d}+\frac {\left (2 b^2\right ) \int \cosh (c+d x) \, dx}{d^2} \\ & = -\frac {2 b (a+b x) \cosh (c+d x)}{d^2}+\frac {2 b^2 \sinh (c+d x)}{d^3}+\frac {(a+b x)^2 \sinh (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.09 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.14 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=\frac {-2 b d (a+b x) \cosh (c+d x)+\left (a^2 d^2+2 a b d^2 x+b^2 \left (2+d^2 x^2\right )\right ) \sinh (c+d x)}{d^3} \]

[In]

Integrate[(a + b*x)^2*Cosh[c + d*x],x]

[Out]

(-2*b*d*(a + b*x)*Cosh[c + d*x] + (a^2*d^2 + 2*a*b*d^2*x + b^2*(2 + d^2*x^2))*Sinh[c + d*x])/d^3

Maple [A] (verified)

Time = 0.18 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.57

method result size
parallelrisch \(\frac {2 x \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b^{2} d +2 \left (-\left (b x +a \right )^{2} d^{2}-2 b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+4 d \left (\frac {b x}{2}+a \right ) b}{d^{3} \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )}\) \(77\)
parts \(\frac {b^{2} x^{2} \sinh \left (d x +c \right )}{d}+\frac {2 a b x \sinh \left (d x +c \right )}{d}+\frac {a^{2} \sinh \left (d x +c \right )}{d}-\frac {2 b \left (\frac {b \left (\left (d x +c \right ) \cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )}{d}-\frac {b c \cosh \left (d x +c \right )}{d}+a \cosh \left (d x +c \right )\right )}{d^{2}}\) \(99\)
risch \(\frac {\left (x^{2} d^{2} b^{2}+2 a b \,d^{2} x +a^{2} d^{2}-2 b^{2} d x -2 d a b +2 b^{2}\right ) {\mathrm e}^{d x +c}}{2 d^{3}}-\frac {\left (x^{2} d^{2} b^{2}+2 a b \,d^{2} x +a^{2} d^{2}+2 b^{2} d x +2 d a b +2 b^{2}\right ) {\mathrm e}^{-d x -c}}{2 d^{3}}\) \(113\)
derivativedivides \(\frac {\frac {b^{2} \left (\left (d x +c \right )^{2} \sinh \left (d x +c \right )-2 \left (d x +c \right ) \cosh \left (d x +c \right )+2 \sinh \left (d x +c \right )\right )}{d^{2}}-\frac {2 b^{2} c \left (\left (d x +c \right ) \sinh \left (d x +c \right )-\cosh \left (d x +c \right )\right )}{d^{2}}+\frac {2 b a \left (\left (d x +c \right ) \sinh \left (d x +c \right )-\cosh \left (d x +c \right )\right )}{d}+\frac {b^{2} c^{2} \sinh \left (d x +c \right )}{d^{2}}-\frac {2 b c a \sinh \left (d x +c \right )}{d}+a^{2} \sinh \left (d x +c \right )}{d}\) \(147\)
default \(\frac {\frac {b^{2} \left (\left (d x +c \right )^{2} \sinh \left (d x +c \right )-2 \left (d x +c \right ) \cosh \left (d x +c \right )+2 \sinh \left (d x +c \right )\right )}{d^{2}}-\frac {2 b^{2} c \left (\left (d x +c \right ) \sinh \left (d x +c \right )-\cosh \left (d x +c \right )\right )}{d^{2}}+\frac {2 b a \left (\left (d x +c \right ) \sinh \left (d x +c \right )-\cosh \left (d x +c \right )\right )}{d}+\frac {b^{2} c^{2} \sinh \left (d x +c \right )}{d^{2}}-\frac {2 b c a \sinh \left (d x +c \right )}{d}+a^{2} \sinh \left (d x +c \right )}{d}\) \(147\)
meijerg \(\frac {4 i b^{2} \cosh \left (c \right ) \sqrt {\pi }\, \left (\frac {i x d \cosh \left (d x \right )}{2 \sqrt {\pi }}-\frac {i \left (\frac {3 x^{2} d^{2}}{2}+3\right ) \sinh \left (d x \right )}{6 \sqrt {\pi }}\right )}{d^{3}}+\frac {4 b^{2} \sinh \left (c \right ) \sqrt {\pi }\, \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\left (\frac {x^{2} d^{2}}{2}+1\right ) \cosh \left (d x \right )}{2 \sqrt {\pi }}-\frac {d x \sinh \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{3}}-\frac {4 b a \cosh \left (c \right ) \sqrt {\pi }\, \left (-\frac {1}{2 \sqrt {\pi }}+\frac {\cosh \left (d x \right )}{2 \sqrt {\pi }}-\frac {d x \sinh \left (d x \right )}{2 \sqrt {\pi }}\right )}{d^{2}}+\frac {2 b a \sinh \left (c \right ) \left (\cosh \left (d x \right ) x d -\sinh \left (d x \right )\right )}{d^{2}}+\frac {a^{2} \cosh \left (c \right ) \sinh \left (d x \right )}{d}-\frac {a^{2} \sinh \left (c \right ) \sqrt {\pi }\, \left (\frac {1}{\sqrt {\pi }}-\frac {\cosh \left (d x \right )}{\sqrt {\pi }}\right )}{d}\) \(198\)

[In]

int((b*x+a)^2*cosh(d*x+c),x,method=_RETURNVERBOSE)

[Out]

2*(x*tanh(1/2*d*x+1/2*c)^2*b^2*d+(-(b*x+a)^2*d^2-2*b^2)*tanh(1/2*d*x+1/2*c)+2*d*(1/2*b*x+a)*b)/d^3/(tanh(1/2*d
*x+1/2*c)^2-1)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 64, normalized size of antiderivative = 1.31 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=-\frac {2 \, {\left (b^{2} d x + a b d\right )} \cosh \left (d x + c\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} + 2 \, b^{2}\right )} \sinh \left (d x + c\right )}{d^{3}} \]

[In]

integrate((b*x+a)^2*cosh(d*x+c),x, algorithm="fricas")

[Out]

-(2*(b^2*d*x + a*b*d)*cosh(d*x + c) - (b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2 + 2*b^2)*sinh(d*x + c))/d^3

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 112 vs. \(2 (48) = 96\).

Time = 0.21 (sec) , antiderivative size = 112, normalized size of antiderivative = 2.29 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=\begin {cases} \frac {a^{2} \sinh {\left (c + d x \right )}}{d} + \frac {2 a b x \sinh {\left (c + d x \right )}}{d} - \frac {2 a b \cosh {\left (c + d x \right )}}{d^{2}} + \frac {b^{2} x^{2} \sinh {\left (c + d x \right )}}{d} - \frac {2 b^{2} x \cosh {\left (c + d x \right )}}{d^{2}} + \frac {2 b^{2} \sinh {\left (c + d x \right )}}{d^{3}} & \text {for}\: d \neq 0 \\\left (a^{2} x + a b x^{2} + \frac {b^{2} x^{3}}{3}\right ) \cosh {\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate((b*x+a)**2*cosh(d*x+c),x)

[Out]

Piecewise((a**2*sinh(c + d*x)/d + 2*a*b*x*sinh(c + d*x)/d - 2*a*b*cosh(c + d*x)/d**2 + b**2*x**2*sinh(c + d*x)
/d - 2*b**2*x*cosh(c + d*x)/d**2 + 2*b**2*sinh(c + d*x)/d**3, Ne(d, 0)), ((a**2*x + a*b*x**2 + b**2*x**3/3)*co
sh(c), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 135 vs. \(2 (49) = 98\).

Time = 0.19 (sec) , antiderivative size = 135, normalized size of antiderivative = 2.76 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=\frac {a^{2} e^{\left (d x + c\right )}}{2 \, d} + \frac {{\left (d x e^{c} - e^{c}\right )} a b e^{\left (d x\right )}}{d^{2}} - \frac {{\left (d x + 1\right )} a b e^{\left (-d x - c\right )}}{d^{2}} - \frac {a^{2} e^{\left (-d x - c\right )}}{2 \, d} + \frac {{\left (d^{2} x^{2} e^{c} - 2 \, d x e^{c} + 2 \, e^{c}\right )} b^{2} e^{\left (d x\right )}}{2 \, d^{3}} - \frac {{\left (d^{2} x^{2} + 2 \, d x + 2\right )} b^{2} e^{\left (-d x - c\right )}}{2 \, d^{3}} \]

[In]

integrate((b*x+a)^2*cosh(d*x+c),x, algorithm="maxima")

[Out]

1/2*a^2*e^(d*x + c)/d + (d*x*e^c - e^c)*a*b*e^(d*x)/d^2 - (d*x + 1)*a*b*e^(-d*x - c)/d^2 - 1/2*a^2*e^(-d*x - c
)/d + 1/2*(d^2*x^2*e^c - 2*d*x*e^c + 2*e^c)*b^2*e^(d*x)/d^3 - 1/2*(d^2*x^2 + 2*d*x + 2)*b^2*e^(-d*x - c)/d^3

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 112 vs. \(2 (49) = 98\).

Time = 0.29 (sec) , antiderivative size = 112, normalized size of antiderivative = 2.29 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=\frac {{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} - 2 \, b^{2} d x - 2 \, a b d + 2 \, b^{2}\right )} e^{\left (d x + c\right )}}{2 \, d^{3}} - \frac {{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} + 2 \, b^{2} d x + 2 \, a b d + 2 \, b^{2}\right )} e^{\left (-d x - c\right )}}{2 \, d^{3}} \]

[In]

integrate((b*x+a)^2*cosh(d*x+c),x, algorithm="giac")

[Out]

1/2*(b^2*d^2*x^2 + 2*a*b*d^2*x + a^2*d^2 - 2*b^2*d*x - 2*a*b*d + 2*b^2)*e^(d*x + c)/d^3 - 1/2*(b^2*d^2*x^2 + 2
*a*b*d^2*x + a^2*d^2 + 2*b^2*d*x + 2*a*b*d + 2*b^2)*e^(-d*x - c)/d^3

Mupad [B] (verification not implemented)

Time = 1.79 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.67 \[ \int (a+b x)^2 \cosh (c+d x) \, dx=\frac {\mathrm {sinh}\left (c+d\,x\right )\,\left (a^2\,d^2+2\,b^2\right )}{d^3}+\frac {b^2\,x^2\,\mathrm {sinh}\left (c+d\,x\right )}{d}-\frac {2\,a\,b\,\mathrm {cosh}\left (c+d\,x\right )}{d^2}-\frac {2\,b^2\,x\,\mathrm {cosh}\left (c+d\,x\right )}{d^2}+\frac {2\,a\,b\,x\,\mathrm {sinh}\left (c+d\,x\right )}{d} \]

[In]

int(cosh(c + d*x)*(a + b*x)^2,x)

[Out]

(sinh(c + d*x)*(2*b^2 + a^2*d^2))/d^3 + (b^2*x^2*sinh(c + d*x))/d - (2*a*b*cosh(c + d*x))/d^2 - (2*b^2*x*cosh(
c + d*x))/d^2 + (2*a*b*x*sinh(c + d*x))/d